<form id="audit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('商品名称')}:</label>
        <div class="col-xs-12 col-sm-8">
            <p class="form-control-static">{$row.name|htmlentities}</p>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('商品价格')}:</label>
        <div class="col-xs-12 col-sm-8">
            <p class="form-control-static">￥{$row.price}</p>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('商品库存')}:</label>
        <div class="col-xs-12 col-sm-8">
            <p class="form-control-static">{$row.stock}</p>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('商品描述')}:</label>
        <div class="col-xs-12 col-sm-8">
            <p class="form-control-static">{$row.description|htmlentities}</p>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('商品图片')}:</label>
        <div class="col-xs-12 col-sm-8">
            {if condition="$row.image"}
            <img src="{$row.image}" style="max-width: 200px; max-height: 200px;" class="img-thumbnail">
            {else/}
            <p class="form-control-static">无图片</p>
            {/if}
        </div>
    </div>
    <div class="form-group">
        <label for="c-status" class="control-label col-xs-12 col-sm-2">{:__('审核结果')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select id="c-status" name="row[status]" class="form-control selectpicker" data-rule="required">
                <option value="">{:__('请选择审核结果')}</option>
                {foreach name="statusList" item="vo" key="k"}
                <option value="{$k}">{$vo}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="form-group" id="reject-reason-group" style="display: none;">
        <label for="c-reject-reason" class="control-label col-xs-12 col-sm-2">{:__('拒绝原因')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-reject-reason" name="row[reject_reason]" class="form-control" rows="3" placeholder="请填写拒绝原因"></textarea>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>

<script>
$(function() {
    // 监听审核结果选择
    $('#c-status').on('change', function() {
        var status = $(this).val();
        if (status == '0') {
            // 审核不通过，显示拒绝原因输入框
            $('#reject-reason-group').show();
            $('#c-reject-reason').attr('data-rule', 'required');
        } else {
            // 审核通过，隐藏拒绝原因输入框
            $('#reject-reason-group').hide();
            $('#c-reject-reason').removeAttr('data-rule');
        }
    });
});
</script>